package com.wyvoid.forum.service;

import com.wyvoid.forum.domain.User;
import com.wyvoid.forum.domain.UserProfile;
import com.wyvoid.forum.exception.user.UsernameNotFoundException;
import com.wyvoid.forum.exception.user.UserExistsException;
import com.wyvoid.forum.exception.user.PasswordFailureException;
import com.wyvoid.forum.exception.admin.AdminLoginFailureException;
import com.wyvoid.core.persistent.hibernate.HibernatePage;
import com.wyvoid.core.persistent.Pagination;
import org.springframework.transaction.annotation.Transactional;

@Transactional
public interface IUserService {
    void createUser(User user, UserProfile userProfile) throws UserExistsException;
    User getUser(long userId);
    void updateUserAndProfile(User user,UserProfile userProfile);
    void updateUser(User user);
    User getUser(String userName);
    long countUser();
    User getNewestUser();
    User loginUser(String username,String password) throws UsernameNotFoundException, PasswordFailureException;

    UserProfile getUserProfile(long userId);
    UserProfile getUserProfileById(long userProfileId);
    UserProfile getUserProfileByUserName(String userName);
    HibernatePage getAllUser(Pagination pagination);
    HibernatePage getSearchUser(String strUserKey,Pagination pagination);
    HibernatePage getSearchUserName(String strUserName,Pagination pagination);
    
    User authLogin(String username, String password) throws AdminLoginFailureException;
}
